package com.aboverock.module.system.service.impl;

import java.util.List;
import java.util.Set;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.aboverock.common.helper.SqlHelper;
import com.aboverock.module.system.domain.RoleResource;
import com.aboverock.module.system.mapper.RoleResourceMapper;
import com.aboverock.module.system.service.RoleResourceService;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Rock Wang
 * @since 2018-04-10
 */
@Service
public class RoleResourceServiceImpl extends ServiceImpl<RoleResourceMapper, RoleResource> implements RoleResourceService {
    @Override
    public List<String> getResourceIdsByRoleId(String roleId) {
        return baseMapper.selectResourceIdsByRoleId(roleId);
    }

    @Override
    public boolean removeByResourceIds(Set<String> resourceIds) {
        return SqlHelper.delBool(baseMapper.removeByResourceIds(resourceIds));
    }

    @Override
    public boolean removeByRoleIdAndResourceIds(String roleId, List<String> resourceIds) {
        return SqlHelper.delBool(baseMapper.removeByRoleIdAndResourceIds(roleId, resourceIds));
    }
}
